package com.ruoyi.party.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.party.domain.PartyPerson;
import com.ruoyi.party.service.IPartyPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.party.mapper.PartyCategoryMapper;
import com.ruoyi.party.domain.PartyCategory;
import com.ruoyi.party.service.IPartyCategoryService;

/**
 * 客户文章分类Service业务层处理
 * 
 * @author myt
 * @date 2024-07-07
 */
@Service
public class PartyCategoryServiceImpl implements IPartyCategoryService 
{
    @Autowired
    private PartyCategoryMapper partyCategoryMapper;

    @Autowired
    private IPartyPersonService partyPersonService;

    /**
     * 查询客户文章分类
     * 
     * @param id 客户文章分类主键
     * @return 客户文章分类
     */
    @Override
    public PartyCategory selectPartyCategoryById(Long id)
    {
        return partyCategoryMapper.selectPartyCategoryById(id);
    }

    /**
     * 查询客户文章分类列表
     * 
     * @param partyCategory 客户文章分类
     * @return 客户文章分类
     */
    @Override
    public List<PartyCategory> selectPartyCategoryList(PartyCategory partyCategory)
    {
        return partyCategoryMapper.selectPartyCategoryList(partyCategory);
    }

    /**
     * 新增客户文章分类
     * 
     * @param partyCategory 客户文章分类
     * @return 结果
     */
    @Override
    public int insertPartyCategory(PartyCategory partyCategory)
    {
        partyCategory.setCreateTime(DateUtils.getNowDate());
        return partyCategoryMapper.insertPartyCategory(partyCategory);
    }

    /**
     * 修改客户文章分类
     * 
     * @param partyCategory 客户文章分类
     * @return 结果
     */
    @Override
    public int updatePartyCategory(PartyCategory partyCategory)
    {
        partyCategory.setUpdateTime(DateUtils.getNowDate());
        return partyCategoryMapper.updatePartyCategory(partyCategory);
    }

    /**
     * 批量删除客户文章分类
     * 
     * @param ids 需要删除的客户文章分类主键
     * @return 结果
     */
    @Override
    public int deletePartyCategoryByIds(Long[] ids)
    {

        return partyCategoryMapper.deletePartyCategoryByIds(ids);
    }

    /**
     * 删除客户文章分类信息
     * 
     * @param id 客户文章分类主键
     * @return 结果
     */
    @Override
    public int deletePartyCategoryById(Long id)
    {
        return partyCategoryMapper.deletePartyCategoryById(id);
    }


}
